home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 16 / AMIGAplus Sonderheft 16 (1998)(ICP)(DE)[!].iso / pd / anwendungen / amicad / arexx_english / autosave.amicad < prev    next >
Text File  |  1998-08-09  |  1KB  |  42 lines

  1. /* Auto saving, © R.Florac, Version 2.01e, 9 août 1998 */
  2.  
  3. port = address()
  4. options results
  5. signal ON error
  6.  
  7. cr = '0a'x
  8.  
  9. sauver_auto=getclip(sauvegarde.port)
  10. if sauver_auto=1 then do
  11.     a=setclip(sauvegarde.port,"")
  12.     'MESSAGE("Automatic saving"+CHR(10)+"interrupted.")'
  13.     exit
  14. end
  15.  
  16. if ~show('l', 'rexxsupport.library') then
  17. do
  18.     if ~addlib('rexxsupport.library',0,-30,0) then do
  19.     'MESSAGE("Install rexxsupport.library"+CHR(10)+"in your libs: drawer"+CHR(10)+"before using this script")'
  20.     exit
  21.     end
  22. end
  23.  
  24. a=setclip(sauvegarde.port,1)
  25. 'MESSAGE("An automatic saving"+CHR(10)+"all two minutes will be"+CHR(10)+"done if the contents of the"+CHR(10)+"current window has been modified."+CHR(10)+"Run this script again"+CHR(10)+"to stop his execution.")'
  26.  
  27. do forever
  28.     call delay(6000)
  29.     if ~show(p, port) then goto error
  30.     sauver_auto = getclip(sauvegarde.port)
  31.     if sauver_auto=1 then do
  32.     'MODIF(-1)'
  33.     if result=1 THEN 'MENU("Save")'
  34.     end
  35.     else
  36.     exit
  37. end
  38.  
  39. error:
  40.     a=setclip(sauvegarde.port,"")
  41.     exit
  42.